package com.yueshop.seckill.config;

import com.yueshop.seckill.interceptor.LoingUserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//拦截器配置到Spring中
@Configuration
public class SeckillWebConfig implements WebMvcConfigurer {
    @Autowired
    LoingUserInterceptor loingUserInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loingUserInterceptor).addPathPatterns("/**");
    }
}
